<html lang="zh-CN">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="./img/icon.png">

    <title>Fixed Top Navbar Example for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="./css/bootstrap.min.css" rel="stylesheet">
	<style type="text/css">
        .show-grid [class ^="col-"] {
            padding-top: 10px;
            padding-bottom: 10px;
            background-color: #eee;
            border: 1px solid #ddd;
            background-color: rgba(86, 61, 124, .15);
            border: 1px solid rgba(86, 61, 124, .2);
        }
        </style>
</head>
<body>
	<div class="container-fluid" style="width: 90%;">
		<div class="row" style="margin-top: 15px; margin-bottom: 15px; border-bottom: 1px solid #eee;">
			<div class="col-md-12">
				<div class="text-center" style=" border-radius:0px; height: 60px; padding-top: 5px; padding-bottom: 5px; /*background-color: #eee;*/">
					<a style="color: #27aac8; font-weight: normal; display: block; padding: 3px 0; text-decoration: none; font-size: 25px;">
						酒店信息
					</a>
				</div>
			</div>
		</div>
		<?php
			include('./db/dbconn.php');
			
			$sql = "select hotel_id, hotel_name, hotel_star, hotel_url from hotel";
			$check_query = mysqli_query($conn, $sql);
			$i = 0;
			while ($result = mysqli_fetch_array($check_query)) {
				$id = $result['hotel_id'];
				
				$hotel_name = $result['hotel_name'];
				$hotel_name = iconv('gbk', 'utf-8', $hotel_name);
				
				$hotel_star = $result['hotel_star'];
				$hotel_star = iconv('gbk', 'utf-8', $hotel_star);
				
				$hotel_url = $result['hotel_url'];
				$hotel_url = iconv('gbk', 'utf-8', $hotel_url);
		?>
		<div class="row show-grid">
			<div class="col-md-2">
				<div style="height: 60px; width: 100px; padding-top: 5px; padding-bottom: 5px;">
					<img src="./css/img/hotel_<?php echo $id-1; ?>.jpg" style="height:40px; width:50px;"/>
				</div>
			</div>
			<div class="col-md-5">
				<div style="height: 60px; width: 300px; padding-top: 5px; padding-bottom: 5px;">
					<strong style="color: #337ab7;"><?php echo $hotel_name; ?></strong>
					<strong>&nbsp;&nbsp;星级:</strong>
					<?php 
						for ($j = 1; $j <= $hotel_star; $j++) {
					?>
						
						<span class="glyphicon glyphicon-star" aria-hidden="true"></span>
					<?php
						}
					?>
					<?php 
						for ($j = 1; $j <= 5-$hotel_star; $j++) {
					?>
						
						<span class="glyphicon glyphicon-star-empty" aria-hidden="true"></span>
					<?php
						}
					?>
				</div>
			</div>
			<div class="col-md-4">
				<div class="pull-right" style="height: 60px; width: 100px; padding-top: 13px; padding-bottom: 13px;">
					<span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
					<a class="" href="<?php echo $hotel_url; ?>" role="button">酒店链接</a>
				</div>
			</div>
		</div>
		<?php
			$i++;
			}
		?>
	</div>
</body>
</html>